package org.demo.mysql.schema.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.demo.mysql.schema.mapper.SchemaMapper;
import org.demo.mysql.schema.model.SchemaInfo;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @Title: SchemaService
 * @Description: []
 * @Author lei.cheng
 * @Date 2024/8/19
 */
@Slf4j
@Service
public class SchemaService extends ServiceImpl<SchemaMapper, SchemaInfo> {

    public List<SchemaInfo> gets() {
        List<SchemaInfo> data = new ArrayList<>();
        List<String> tables = baseMapper.getTables();
        tables.forEach(t -> {
            data.addAll(baseMapper.get("szda", t));
        });
        return data;
    }
}
